package com.itheima_01;

import java.util.Random;

public class Testk {
    public static void main(String[] args) {
        Random r =new Random();
        int arr[]=new int[5];
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(100) + 1;
        }
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        System.out.println("sum="+sum);
        for (int i = 0; i < arr.length; i++) {
            if(i%2==0&&arr[i]%2==0){
                System.out.println(arr[i]);
            }
        }
    }
}
